package com.fer.tankr.activities;

import android.app.Activity;
import android.os.Bundle;

import com.fer.tankr.GlobalState;
import com.fer.tankr.R;
import com.parse.LogInCallback;
import com.parse.ParseException;
import com.parse.ParseFacebookUtils;
import com.parse.ParseUser;

public class Login extends Activity {

	public final static String FACEBOOK_APP_ID = "327891523972361";
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
		
		ParseFacebookUtils.initialize(FACEBOOK_APP_ID, true);
		ParseFacebookUtils.logIn(this, getLogInCallback());
	}

	private LogInCallback getLogInCallback() {
		return new LogInCallback() {
			
			@Override
			public void done(ParseUser user, ParseException exception) {
				if (user == null)
				{
					
				}
				else
				{
					GlobalState.get().setUser(user);
				}
			}
		};
	}



}
